package com.example.baseappstore.utils.net;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

import com.example.baseappstore.MyApplication;
import com.google.gson.Gson;

public class CommonUtils {

    private static final Gson gson = new Gson();

    public static Gson getGson() {
        return gson;
    }

    public static void showToast(String message) {
        MyApplication.getMainHandler().post(() -> {
            Toast.makeText(MyApplication.getContext(), message, Toast.LENGTH_SHORT).show();
        });
    }


    public static  <T extends Activity> void  startActivity(Context context,Class<T> clazz){
        context.startActivity(new Intent(context,clazz));
    }
}
